<?php
        define("GRID_SOURCE", "");
        include(GRID_SOURCE."class/gridclasses.php"); //Include the grid engine.

        session_start();
		require_once "../funciones.php";	
        $grid_id = array("grid");
        unset($_SESSION["grid"]);
        include(GRID_SOURCE."class/gridcreate.php"); //Creates grid objects.
?>
<html>
        <head>
            <title>Movimientos</title>
            <script language="Javascript" type="text/javascript" src="<?php print(GRID_SOURCE);?>javascript/javascript.js"></script>
            <link href="<?php print(GRID_SOURCE);?>css/style.css" rel="stylesheet" type="text/css">
			<script type='text/javascript' src="<?php print(GRID_SOURCE);?>server.php?client=all"></script>
			<script>
			HTML_AJAX.defaultServerUrl = '<?php print(GRID_SOURCE);?>server.php';
			</script>
			<script src="caweb2.js"></script>
            <script type="text/javascript" src="jquery.js"></script>
        </head>

        <body onload="funcion_focus();">

<?php

		if ($_SESSION['caweb']['iniciar'] == 1)
		{
		?>

		Interno :<input type="text" id="Editbox1" onkeypress="funcion_validar_ecl(event,this.value);" 
		size="15" name="Editbox1" value="">

	<?php
			$transaccion=$_SESSION['caweb']['consecutivo'];
			$bodegaactualitem=$_SESSION['caweb']['bodegaactualitem'];
			$sucursalactualitem=$_SESSION['caweb']['sucursalactualitem'];
			echo  "Ultimo Interno ".$_SESSION['caweb']['ultimointerno'];
			if ($_SESSION['caweb']['resultado'] == 0) { echo "<font color=red><b> NO existente</b></font>"; }
		 	if ($_SESSION['caweb']['resultado'] == 1) { echo "<font color=green><b> OK, INTERNO sera Auto Legalizado.. </b></font>"; }
			if ($_SESSION['caweb']['resultado'] == 2) { echo "<font color=black><b> Sin datos </b></font>"; }
                        if ($_SESSION['caweb']['resultado'] == 3) { echo "<font color=red><b> INTERNO YA ESTA EN ESTA TRANSACCION ($transaccion) </b></font>"; }
			if ($_SESSION['caweb']['resultado'] == 4) { echo "<font color=red><b> ERROR Interno, No se encuentra en bodega CLI</b></font>"; }
			if ($_SESSION['caweb']['resultado'] == 5) { echo "<font color=red><b> Ojo Este Interno es esperado en Entrada por cambio </b></font>"; }
   			if ($_SESSION['caweb']['resultado'] == 6) { echo "<font color=red><b> Interno no esperado de este cliente por TC, enviado a PLE  </b></font>"; }
   			
			$consecutivo=$_SESSION['caweb']['consecutivo'];
			$condicion="transaccion='$consecutivo'";
            $_SESSION["grid"]->SetDatabaseConnection($_SESSION['caweb']['basededatos'], "caweb", "caweb");

            $_SESSION["grid"]->SetSqlSelect('id, interno, item, cantidad, estado, bodegadestino, calidad, observacion', 'temporal', $condicion);
			$_SESSION["grid"]->SetUniqueDatabaseColumn("id", false);
			$_SESSION["grid"]->SetTitleName("Internos ENTRADA Cliente por TC");
			$_SESSION["grid"]->SetEditModeEdit(true);
			$_SESSION["grid"]->SetMaxRowsEachPage(15);
       	    $_SESSION["grid"]->SetDatabaseColumnEditable("id", false);
			$_SESSION["grid"]->SetDatabaseColumnEditable("interno", false);
			$_SESSION["grid"]->SetDatabaseColumnEditable("cantidad", false);
            $_SESSION["grid"]->SetDatabaseColumnEditable("item", false);
            $_SESSION["grid"]->SetDatabaseColumnEditable("estado", true);
            $_SESSION["grid"]->SetDatabaseColumnEditable("calidad", true);
            $_SESSION["grid"]->SetDatabaseColumnEditable("bodegadestino", false);
            $_SESSION["grid"]->SetDatabaseColumnEditable("observacion", false);
			$_SESSION["grid"]->SetShowExcelIco(false);
			$_SESSION["grid"]->SetShowPrintIco(true);
			$_SESSION["grid"]->PrintGrid(MODE_EDIT);
	}
	?>
 </body> 
</html>